package com.libreaccess.reporting.scheduler;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

public class CronTriggerExpr implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private String seconds = "*";
	private String minutes = "*";
	private String hours = "*";
	private String dayOfMonth = "*";
	private String month = "*";
	private String dayOfWeek = "*";
	private String year = "*";
	private Date nextFireTime = new Date(0);

	public CronTriggerExpr() {

	}

	public String getSeconds() {
		return seconds;
	}

	public void setSeconds(String seconds) {
		this.seconds = seconds;
	}
	
	public String getMinutes() {
		return minutes;
	}

	public void setMinutes(String minutes) {
		this.minutes = minutes;
	}

	public String getHours() {
		return hours;
	}

	public void setHours(String hours) {
		this.hours = hours;
	}
	
	public String getDayOfMonth() {
		return dayOfMonth;
	}

	public void setDayOfMonths(String dayOfMonth) {
		this.dayOfMonth = dayOfMonth;
	}
	
	public String getMonth() {
		return month;
	}

	public void setMonths(String month) {
		this.month = month;
	}
	
	public String getDayOfWeek() {
		return dayOfWeek;
	}

	public void setDayOfWeek(String dayOfWeek) {
		this.dayOfWeek = dayOfWeek;
	}
	
	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}
	
	public String getExpression() {
		return String.format("%s %s %s %s %s %s %s", seconds, minutes, hours, dayOfMonth, month, dayOfWeek, year);
	}
	
	public void setNextFireTime(Date nextFireTime) {
		this.nextFireTime = nextFireTime;;
	}
	public Date getNextFireTime() {
		return nextFireTime;
	}
/*	public Calendar getNextRunDate() {
		Calendar cal = Calendar.getInstance();
		cal.set(1970, 1, 1, 1, 1);
		return cal; //will generate date
	}*/
}
